#这是基本类
from selenium import webdriver

#定义一个BasePage类，继承object
class BasePage(object):

    #构造函数
    def __init__(self, driver):
        self.driver = driver

    # 关闭浏览器释放资源
    def close_brower(self):
        self.driver.quit()

    # 元素定位
    def locator(self, locator):
       return self.driver.find_element(*locator)

    #访问url
    def visit(self,url):
        self.driver.get(url)

    #获取title
    def get_title(self):
        return self.driver.title




